import instance from "../../API/request"

// 获取表格数据
export const getTableData = () => {
  return instance.get("/shangJi")
}
// 删除表格数据
export const deleteTableData = (id: number) => {
  return instance.delete(`/shangJi/${id}`)
}
// 新增表格数据
export const addTableData = (data: any) => {
  return instance.post("/shangJi", data)
}
// 修改表格数据
export const editTableData = (id: number, data: any) => {
  return instance.patch(`/shangJi/${id}`, data)
}
// 获取表格数据详情
export const searchData = (body:any) => {
  return instance.get(`/shangJi`,{
    params: {
      title_like                : body?.title                 ? body?.title               : undefined,
      Associated_customer_like  : body?.Associated_customer   ? body?.Associated_customer : undefined,
      stage_like                : body?.stage                 ? body?.stage               : undefined,
      records_gte               : body?.records               ? body?.records             : undefined,
      price_gte                 : body?.price                 ? body?.price               : undefined,
      key_lte                   : body?.key                   ? body?.key                 : undefined
    }
  })
}